Update list of US Letter locales
authorCaolán McNamara <caolanm@redhat.com>
Tue, 11 May 2010 14:38:07 +0000 (16:38 +0200)
committerMarek Kasik <mkasik@redhat.com>
Tue, 11 May 2010 14:38:07 +0000 (16:38 +0200)
Sync paper size fallbacks with the latest 1.8.1 CLDR table (#618000).

gtk/gtkpapersize.c

index 7188cefe6c430f7608c4299fe47b1c38300c6ae6..894dca0b87969dae23a89052b1ff2407e405f389 100644 (file)
@@ -669,10 +669,11 @@ gtk_paper_size_get_default (void)
   if (!locale)
     return GTK_PAPER_NAME_A4;
 
-  if (g_str_has_prefix (locale, "en_CA") ||
-      g_str_has_prefix (locale, "en_US") ||
-      g_str_has_prefix (locale, "es_PR") ||
-      g_str_has_prefix (locale, "es_US"))
+  /* CLDR 1.8.1
+   * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/territory_language_information.html
+   */
+  if (g_regex_match_simple("[^_.@]{2,3}_(BZ|CA|CL|CO|CR|GT|MX|NI|PA|PH|PR|SV|US|VE)",
+                           locale, G_REGEX_ANCHORED, G_REGEX_MATCH_ANCHORED))
     paper_size = GTK_PAPER_NAME_LETTER;
   else
     paper_size = GTK_PAPER_NAME_A4;